<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <!-- 给html标签的属性绑定值：用 v-bind，它是单向绑定 -->
    <div id="app">
        <a v-bind:href="link">gogogo</a>
        <!--
            样式的动态变化 
            class,style  {class名：是否加上通过true或false实现}
            text-danger 要么用单引号，要么驼峰命名
            fontSize 要么用单引号，要么驼峰命名
        -->
        <span v-bind:class="{active:isActive,'text-danger':hasError}" :style="{color: color1,fontSize: size}">你好</span>
    </div>

    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        let vm = new Vue({
            el: "#app",
            data: {
                link: "http://www.baidu.com",
                isActive: true,
                hasError: true,
                color1: 'red',
                size: '36px'
            }
        })
    </script>
</body>

</html>